package MTT::Schema::Result::Report;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use Moose;
use MooseX::NonMoose;
use namespace::autoclean;
extends 'DBIx::Class::Core';

__PACKAGE__->load_components("InflateColumn::DateTime", "EncodedColumn");

=head1 NAME

MTT::Schema::Result::Report

=cut

__PACKAGE__->table("reports");

=head1 ACCESSORS

=head2 id

  data_type: 'integer'
  is_auto_increment: 1
  is_nullable: 0

=head2 id_user

  data_type: 'integer'
  is_foreign_key: 1
  is_nullable: 0

=head2 name

  data_type: 'varchar'
  is_nullable: 0
  size: 42

=head2 date_create

  data_type: 'timestamp'
  default_value: current_timestamp
  is_nullable: 0

=head2 comment

  data_type: 'text'
  is_nullable: 1

=cut

__PACKAGE__->add_columns(
  "id",
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
  "id_user",
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
  "name",
  { data_type => "varchar", is_nullable => 0, size => 42 },
  "date_create",
  {
    data_type     => "timestamp",
    default_value => \"current_timestamp",
    is_nullable   => 0,
  },
  "comment",
  { data_type => "text", is_nullable => 1 },
);
__PACKAGE__->set_primary_key("id");

=head1 RELATIONS

=head2 report_params

Type: has_many

Related object: L<MTT::Schema::Result::ReportParam>

=cut

__PACKAGE__->has_many(
  "report_params",
  "MTT::Schema::Result::ReportParam",
  { "foreign.id_report" => "self.id" },
  { cascade_copy => 0, cascade_delete => 0 },
);

=head2 report_stores

Type: has_many

Related object: L<MTT::Schema::Result::ReportStore>

=cut

__PACKAGE__->has_many(
  "report_stores",
  "MTT::Schema::Result::ReportStore",
  { "foreign.id_report" => "self.id" },
  { cascade_copy => 0, cascade_delete => 0 },
);

=head2 id_user

Type: belongs_to

Related object: L<MTT::Schema::Result::User>

=cut

__PACKAGE__->belongs_to(
  "id_user",
  "MTT::Schema::Result::User",
  { id => "id_user" },
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);


# Created by DBIx::Class::Schema::Loader v0.07002 @ 2011-04-23 14:00:32
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GpXE/zYoiIa9FNHFemmW/w


# You can replace this text with custom content, and it will be preserved on regeneration
__PACKAGE__->has_many(
  "report_stores",
  "MTT::Schema::Result::ReportStore",
  { "foreign.id_report" => "self.id" },
  { cascade_copy => 1, cascade_delete => 0 },
);

__PACKAGE__->meta->make_immutable;
1;
